home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac100% 1998 November
/
MAC100-1998-11.ISO.7z
/
MAC100-1998-11.ISO
/
オンラインソフト定点観測
/
ユーティリティ
/
Mops 3.2.sea
/
Mops 3.2
/
Quick Edit ƒ
/
QEconsole
< prev
next >
Wrap
Text File
|
1996-03-02
|
3KB
|
156 lines
¥ string+ QEstr ¥ 12Nov95 DBH already defined in Mops release
: .S++ ¥ 29Jan94 DBH
ok
depth 0<= IF cr EXIT THEN
sp@ depth 2- 4* +
depth 1- FOR dup .cell 4- NEXT drop cr
;
: QEtype ( addr len -- )
text: tQE ;
: QEemit ( char -- )
emitvar c!
emitvar 1 QEtype ;
: QEcr
cr: tQE drop ; ¥ should error check?
: QEsps
dup 0<= IF drop EXIT THEN
pad swap 2dup bl fill QEtype ;
: qeErrDump cr SRC-START SRC-LEN QEtype
cr >in @ 1- spaces & ^ emit ;
: OpenToError
topFile nilP <>
IF ¥ We try to open the source in QE. We don't use LOCATE_SRC
¥ since here we only want a source display if it's QE.
topFile ?open_in_QE
pos: topFile move_curs
THEN ;
resource QEerrorRes
: qeDIE
OpenToError
-echo 0 -> (err#) ¥ Clear error indicator from AppleEvents
'type STR swap set: QEerrorRes
getnew: QEerrorRes
lock: QEerrorRes
cr ptr: QEerrorRes count QEtype
unlock: QEerrorRes
qeErrDump
cr cl3
unlock: QEstr
become EventLoop ;
: QEquit
unlock: QEstr
become EventLoop ;
: >QECONS
true -> prompt?
['] QEtype -> typevec
['] QEemit -> emitvec
['] QEcr -> crvec
['] QEsps -> spvec
['] QEemit -> echovec
['] null -> setfwind
['] qeDIE -> dflt-die
['] QEquit -> quitvec
;
¥ ' >QECONS -> SuspendVec ¥ going to Quick Edit, probably
' NEWVECS -> ResumeVec
: skip_line
13 chsearch: QEstr
negate more: QEstr
delete: QEstr nolim: QEstr ;
: skip1
1 skip: QEstr ;
: BL->CR/TB { ¥ notparms -- }
true -> notparms
reset: QEstr
BEGIN
len: QEstr
WHILE
1st: QEstr
CASE[ & ¥ ]=> notparms IF skip_line ELSE skip1 THEN
[ & { ]=> false -> notparms skip1 ¥ do not allow skip_line after a '{' until '}'
[ & } ]=> true -> notparms skip1 ¥ ok to allow skip_line after a '}'
[ 13 ]=> skip1 ¥ DO NOT replace cr's ¥ 23Jan94 DBH
[ 0 31 RANGE]=> 32 chovwr: QEstr
DEFAULT=> drop skip1
]CASE
REPEAT
reset: QEstr ;
: DoEvaluate ¥ 23Jan94 DBH
begin: QEstr
BEGIN
nextline?: QEstr
WHILE
get: QEstr evaluate
REPEAT ;
: EvalFromQE
BL->CR/TB
lock: QEstr
¥ get: QEstr evaluate
DoEvaluate ¥ 23Jan94 DBH
unlock: QEstr
prompt? IF .s++ THEN
;
: DoHLevent ¥ ( -- b )
msgClass: fEvent 'type TEXT = ¥ a simple check for proper class
IF
msgID: fEvent put: QEhand ¥ message ID is merely the handle from QE
ptr: QEhand size: QEhand put: QEstr
evalFromQE ¥ update: TW cr ¥ 01Feb94 DBH Need the cr to insert: tw
prompt? not IF cr THEN
true ¥ we did handle the event
wnd TW = IF newvecs update: TW THEN
ELSE
false ¥ we did not handle the event
THEN
;
: InitQEconsole
instld? ?EXIT ¥ Mustn't do this in installed apps
true -> resume?
['] DoHLevent -> HLeventVec
new: QEstr ;
InitQEconsole
' InitQEconsole add: init_actions
¥ need to redefine NEWVECS to also reset dflt-die
:f NEWVECS
false -> prompt?
['] xemit -> emitvec
['] xcr -> crvec
['] xtyp -> typevec
['] xsps -> spvec
['] xemit -> echovec
['] setTW -> setfWind
['] xquit -> quitvec
['] bye+ -> byevec
¥ here's what's new
['] err_src -> dflt-die
;f